package com.dictionary.pojo;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @Classname Result
 * @Description TODO
 * @Date 2025/5/15 21:11
 * @Created by xxx
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class Result {
    private int code;
    private String message;
    private Object data;

    public static Result success(Object data) {
        return Result.builder().code(200).message("success").data(data).build();
    }

    public static Result error(String message) {
        return Result.builder().code(500).message(message).data(null).build();
    }
}
